#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LEN 20
int main(int argc, char *argv[])
{
 	char file_copy[LEN];
	FILE *sor,*tag;
	int i =0;
	if(argc != 3)
	{
		printf("Usage: %s filename\n", argv[0]);
		exit(EXIT_FAILURE);
	}
	if((sor = fopen(argv[1], "r")) == NULL)
	{
		fprintf(stderr,"can't open %s\n", argv[1]);
		exit(EXIT_FAILURE);
	}
//	while(fscanf(sor,"%20s", file_copy) == 1)
	while(fgets(file_copy, 20, sor))
	{
		fprintf(stdout,"copy sucessful\n");
	}
	if((tag = fopen(argv[2], "w")) == NULL)
	{
		fprintf(stderr,"can't open %s\n", argv[2]);
		exit(EXIT_FAILURE);		
	}
	fputs(file_copy, tag);
//	fprintf(tag, "%20s\n", file_copy); 
	if(fclose(sor) != 0 || fclose(tag) != 0)
	{
		fprintf(stderr,"Error in close file\n");
	}
	
	return 0;
}
